
<%- include header %>
<!-- 主题内容start -->
<table class="table table-bordered table-striped table-condensed table-hover">
    <tr>
        <th class="span3" colspan="5"><h4 style="text-align: center">语言(总数：<%- datas.length %>个)</h4></th>
    </tr>
    <tr>
        <th class="span3">名称</th>
        <th class="span3">描述</th>
        <th class="span2">帖子总数</th>
        <th class="span2">总点击量</th>
        <th class="span2">操作</th>
    </tr>
    <% datas.forEach(function(data,index){ %>
    <tr>
        <td>
            <a href="/manager/groupPost?id=<%- data._id %>"><%- data.platename %></a>
        </td>
        <td>
            <%- data.describe %>
        </td>
        <td>
            <%- data.postTotal %>
        </td>
        <td>
            <%- data.hits %>
        </td>
        <td>
            <a id="t<%- data._id %>" class="btn btn-success btn-small" data-toggle="modal">修改</a>
            <a class="btn btn-danger btn-small" onclick="delPlate('<%- data._id %>')">删除</a>
            <div id="win<%- data._id %>" iconCls="icon-save" >
                <form class="form-horizontal" method="post" action="/manager/plateEdit">
                    <input type="hidden"  name="id" value="<%- data._id %>">
                    <fieldset>
                        <legend>修改</legend>
                        <div class="control-group">
                            <label class="control-label">语言名称</label>
                            <div class="controls">
                                <input type="text" class="input-xlarge"  name="platename" value="<%- data.platename %>">
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">语言描述</label>
                            <div class="controls">
                                <textarea style="height: 200px;width: 0px" name="describe" ><%- data.describe %></textarea>
                            </div>
                        </div>
                        <div class="form-actions">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </fieldset>
                </form>
            </div>
        </td>
    </tr>

    <% }) %>
</table>
<!-- 主题内容end -->
<%- include footer %>
<script>
    function delPlate(id){
        var prompt=confirm("你确定删除吗？？");

        if(prompt){

            window.location.href="/manager/delPlate?id="+id;
        }
    }
    $(function(){
        <% datas.forEach(function(data,index){ %>
        $('#win<%- data._id %>').window({
            title: '菜单',
            width: 950,
            modal: true,
            shadow: true,
            closed: true,
            height: 450,
            resizable:false
        });
        $("#t<%- data._id %>").click(function(){
            $('#win<%- data._id %>').window('open');
        })
        <% }) %>
    })
</script>



